package cn.IT.Nf.Test.main;

import cn.IT.Nf.Test.Dao.Impl.StaffsDaoImpl;
import cn.IT.Nf.Test.Dao.StaffsDao;
import cn.IT.Nf.Test.Entity.Staffs;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

public class test {
    public static void main(String[] args) {
        StaffsDao staffsDao = new StaffsDaoImpl();
        Map<String, Object> staffs = staffsDao.selectById(1);
        System.out.println("根据ID查询staffs,返回Map<String, Object>:" + staffs);
        List<Map<String, Object>> staffsList = staffsDao.selectAll();
        System.out.println("查询所有staffs,返回List<Map<String, Object>>:" + staffsList);
        Staffs staffs1 = staffsDao.selectId(1);
        System.out.println("根据ID查询staffs,返回Staffs:" + staffs1);
        List<Staffs> staffsList1 = staffsDao.select();
        System.out.println("查询所有staffs,返回List<Staffs>:" + staffsList1);
        String name = staffsDao.selectNameById(1);
        System.out.println("根据ID查询staffs的name,返回String:" + name);
        long count = staffsDao.count();
        System.out.println("查询所有staffs的记录数,返回long:" + count);
        List<String> nameList = staffsDao.selectName();
        System.out.println("查询所有staffs的name,返回List<String>:" + nameList);
        Object[] object = staffsDao.selectObject(2);
        System.out.println("根据ID查询staffs,返回Object[]:" + Arrays.toString(object));
        List<Object[]> objectList = staffsDao.selectObjectList();
        System.out.println("查询所有staffs,返回List<Object[]>:" + objectList);
        for (Object[] objects : objectList) {
            System.out.println(Arrays.toString(objects));
        }
    }
}
